<html>
<head>
<title>WIKINDX DOCUMENTATION</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/wikindx2/docs/docs.css" type="text/css" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h2>WIKINDX ~ Structure</h2>
<h4>wikindx3/ directory structure</h4>
<p>
The toplevel contains a variety of directories in addition to the files 
<i>config.php</i>, the gateway <i>index.php</i> and various readme files.<br />
</p>
<p>
<i><em>attachments/</em> </i>A world-writeable repository for files attached to resources. <i><br>
core/</i>&nbsp;&nbsp;The core PHP code for WIKINDX containing classes 
organized by function into directories<br />
<i>docs/</i>&nbsp;&nbsp;The WIKINDX documentation.<br />
<i>files/</i>&nbsp;&nbsp;A world-writeable directory where WIKINDX deposits its 
exported RTF, BibTeX files etc.  The file export classes will create new 
directories within this named for the user's SESSION_ID. Since some compression 
programs will not add empty directories to the ZIP file when packaging a 
WIKINDX release, the files/ directory always has the file FILE within it.<br />
<i>languages/</i>&nbsp;&nbsp;Language/localization files used by WIKINDX.<br />
<i>modules/</i>&nbsp;&nbsp;A world-writeable directory used for user-installed plug-in modules.<br />
<i>styles/</i>&nbsp;&nbsp;Bibliographic style files used by WIKINDX.<br />
<i>templates/</i>&nbsp;&nbsp;Template files used by WIKINDX.<br />
<i>update/</i>&nbsp;&nbsp;Contains files used by WIKINDX when installing/upgrading/updating 
the system. These files are SQL text files used by 
core/systemcheck/SYSTEMCHECK.php to install or upgrade database structures.

</p>

<h4>Program Flow</h4>
<p>1/ index.php is the gatekeeper to the system and has three functions:<br />
a) to check WIKINDX has been configured correctly;<br />
b) to authorize access (via the AUTHORIZE class) and<br />
c) once authorization has been obtained, to parse the 'action' variable 
from the HTTP query string and launch the appropriate class and method.</p>

<p>All usage in WIKINDX goes via index.php. Barring any errors, the browser 
print string $pString (see below) is finally returned to index.php and 
passed to the <a href="classes/html/closeClass.html">CLOSE</a> class for closure 
of the script.</p>
<p>2/ Two variables 
obtained in index.php can be passed by name through the classes to the 
constructor of each class:<br />a) $this->db is the database object obtained 
from the database abstraction class core/sql/SQL.php and<br />
b) $this->vars is an associative array that is a 
duplication of $HTTP_POST_VARS, $HTTP_GET_VARS, $_POST or 
$_GET:&nbsp;&nbsp;whichever core/init/INIT.php decides is being used.</p>
<p>3/ All WIKINDX classes are found in the 'core/' folder within wikindx2/.</p>

<p>4/ Each WIKINDX class file will contain only one class of the same name (see 
above) although it may contain a variety of methods.</p>

<p>5/ All WIKINDX files must have the standard GNU GPL license at the top.</p>


<h4>Printing to the web browser</h4>
<p>In the vast majority of cases, printing to the browser occurs only when 
<a href="classes/html/closeClass.html">CLOSE</a> is created as a new object 
(this is normally done at the end of index.php). Not printing WIKINDX output to 
the browser as the scripts progresses allows any error messages causing script termination to be cleanly 
printed and not mixed up with other data.
</p>
<p>By convention, $pString or, in some cases, $this->pString such as in 
<a href="classes/init/systemcheckClass.html">SYSTEMCHECK</a>, is used as a concatenated browser output 
string that is usually the return from a class method and that, along with the 
database object (see above), is returned to the <a 
href="classes/html/closeClass.html">CLOSE</a> class<br /><pre>
	new CLOSE($db,$pString);</pre>
as the final stage of the script.</p>

<p align="right"><a href="index.html">WIKINDX home</a></p>
</body>
</html>
